# -*- encoding=utf-8 -*-

from froModuleDrivers.homeDeviceDriver import HomeDeviceDriver # 引用家居设备控制器驱动模块
from froModuleDrivers.nioManager import NioManager # 引用驱动管理模块
import time

# 驱动初始化
driver_home = HomeDeviceDriver("192.168.4.100", 4001)
manager = NioManager(driver_home)
manager.run()

# 灯光控制有3个相关API
# 1、获取当前灯光打开状态,1:打开;0:关闭
print(driver_home.isLightOpen(4))
time.sleep(1)
# 2、控制灯光打开
driver_home.openLight(4)
time.sleep(1)
# 3、控制灯光关闭
driver_home.closeLight(4)
time.sleep(1)

manager.shutdownGracefully()



